public class Login {




    private String name="qqq";
    private String passard="1234q";


    public void login(String name,String passard)throws nameErrorException,passardErrorException{
        if(!this.name.equals(name)){
            throw new nameErrorException("用户名错误！……");

        }
        if(!this.passard.equals(passard)){
            throw new passardErrorException("密码错误！……");

        }

        System.out.println("登录成功！");

    }


    public static void main(String[] args)throws nameErrorException,passardErrorException {
        Login l1 = new Login();

        try{
            l1.login("qpq","1234q");

        }catch(nameErrorException e){
            e.printStackTrace();
            System.out.println("用户名错误……");
        }catch(passardErrorException e){
            e.printStackTrace();
            System.out.println("密码错误！……");
        }

        System.out.println("1111");

    }
}
